home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
machack
/
Hacks96
/
FlyPaper.sit
/
Fly Paper
/
FlyPaper Source
/
App Sources
/
ST_
/
ST_MacClasses.h
< prev
next >
Wrap
Text File
|
1996-06-22
|
2KB
|
92 lines
#ifndef ST_MACCLASSES_H
#define ST_MACCLASSES_H
#include "ST_.h"
#include <MixedMode.h>
#include <CodeFragments.h>
#include <Quickdraw.h>
#include <Resources.h>
#include <AppleEvents.h>
#include <Aliases.h>
#include <Drag.h>
/* Drag Manager */
DECLARE_ST_ (ST_DragReference, DragReference, DisposeDrag, 0)
/* Memory Manager */
DECLARE_ST_ (ST_Ptr, Ptr, DisposePtr, nil)
DECLARE_ST_ (ST_Handle, Handle, DisposeHandle, nil)
DECLARE_ST_ (ST_ZoneSaver, THz, SetZone, nil)
/* Resource Manager */
DECLARE_ST_ (ST_ResourceHandle, Handle, ReleaseResource, nil)
DECLARE_ST_ (ST_ResFileSaver, short, UseResFile, -1)
DECLARE_ST_ (ST_ResFileCloser, short, CloseResFile, -1)
/* QuickDraw */
DECLARE_ST_ (ST_GrafPortSaver, GrafPtr, SetPort, nil)
DECLARE_ST_ (ST_RgnHandle, RgnHandle, DisposeRgn, nil)
/* File Manager */
DECLARE_ST_ (ST_FileCloser, short, FSClose, 0)
/* MixedMode Manager */
/* temporarily turn off ';' warning generated under 68K builds */
#pragma warn_possunwant off
DECLARE_ST_ (ST_RoutineDescriptor, UniversalProcPtr, DisposeRoutineDescriptor, nil)
#pragma warn_possunwant reset
/* Code fragment manager */
DECLARE_STP_ (ST_ConnectionID, ConnectionID, CloseConnection, 0)
/* AppleEvent Manager */
class ST_AEDesc {
private:
AEDesc theAEDesc;
void operator = (const AEDesc &aAEDesc);
public:
ST_AEDesc (const AEDesc &aAEDesc) {theAEDesc = aAEDesc;}
~ST_AEDesc () {if (theAEDesc.dataHandle) AEDisposeDesc (&theAEDesc);}
operator AEDesc& (void) {return theAEDesc;}
void Forget (void) {theAEDesc.dataHandle = nil;}
};
/* Alias Manager */
class ST_AliasHandle {
private:
AliasHandle theAlias;
void operator = (const AliasHandle &anAlias);
public:
ST_AliasHandle (const AliasHandle &anAlias) {theAlias = anAlias;}
~ST_AliasHandle () {if (theAlias) DisposeHandle ((Handle)theAlias);}
operator AliasHandle& (void) {return theAlias;}
void Forget (void) {theAlias = nil;}
};
/* More Memory Manager... */
class ST_HandleStateSaver {
private:
Handle theHandle;
SignedByte theState;
void operator = (const Handle &aHandle);
public:
ST_HandleStateSaver (const Handle &aHandle) : theHandle (aHandle) {theState = HGetState (aHandle);}
~ST_HandleStateSaver () {if (theHandle) RestoreState ();}
operator SignedByte& (void) {return theState;}
void Forget (void) {theHandle = nil;}
void RestoreState (void) {HSetState (theHandle, theState); }
};
#endif